﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using CoralNode.MvcClient.Route;
using CoralNode.MvcClient.Route.Constraints;

namespace Gongfu
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {

            routes.MapNode(
                 name: "Account",
                 url: "account/{action}/{id}",
                 defaults: new { controller = "Account", action = "Index", id = UrlParameter.Optional },
                 constraints: new { id = new IdRouteConstraint() },
                 namespaces: new[] { "Gongfu.Controllers.*" }
            );

            routes.MapNode(
                 name: "Vote",
                 url: "vote/{action}/{id}",
                 defaults: new { controller = "Vote", action = "Index", id = UrlParameter.Optional },
                 constraints: new { id = new IdRouteConstraint() },
                 namespaces: new[] { "Gongfu.Controllers.*" }
            );

            routes.MapNode(
                 name: "Work",
                 url: "worknode/{action}/{id}",
                 defaults: new { controller = "WorkNode", action = "Index", id = UrlParameter.Optional },
                 constraints: new { id = new IdRouteConstraint() },
                 namespaces: new[] { "Gongfu.Controllers.*" }
            );
        }
    }
}
